package com.xunai.saas.example.controller;

import com.xunai.saas.example.model.enums.PublicEnum;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用于接收回调结果,并通过日志输出
 *
 * @author Admin
 */
@RequestMapping("/callBack")
@RestController
public class CallBackController {

    private final static Logger log = LoggerFactory.getLogger(CallBackController.class);

    @PostMapping("/notifyResult")
    public String getNotifyResult(@RequestBody String result) {
        log.info("接收回调内容:\n{}", result);
        return PublicEnum.NOTIFY_RETURN.getKey();
    }
}
